package com.dev;
import android.widget.LinearLayout;
import android.widget.Space;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View;
import android.widget.TextView;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.ViewGroup;
public class GUICollections extends LinearLayout implements OnClickListener,OnLongClickListener{
	MainActivity ma;
	LinearLayout titlebar;
	LayoutParams titlebarlp;
	LayoutParams pageLayoutParams;
	IconView ivQuit;
	CollectionListView clv;
	int pageIndex;
	TextView title;
	GUICollections(MainActivity ma){
		super(ma);
		this.ma=ma;
		setOrientation(VERTICAL);
		ivQuit=new IconView(ma);
		ivQuit.setImageResource(R.drawable.ic_quit_thin);
		ivQuit.setOnClickListener(this);
		title=new TextView(ma);
		title.setText("收藏");
		title.setTextSize(TypedValue.COMPLEX_UNIT_DIP,14);
		title.setTextColor(0xff000000);
		title.setGravity(Gravity.CENTER_VERTICAL);
		titlebar=new LinearLayout(ma);
		titlebar.setOrientation(HORIZONTAL);
		titlebar.setBackgroundColor(ma.titlebarBackgroundColor);
		titlebar.addView(ivQuit);
		titlebar.addView(new Space(ma),new LayoutParams(0,-1,1f));
		titlebar.addView(title,-2,-1);
		titlebarlp=new LayoutParams(-1,ma.titlebarHeight);
		clv=new CollectionListView(ma);
		pageLayoutParams=new LayoutParams(-1,0,1f);
		addView(titlebar,titlebarlp);
		addView(clv,pageLayoutParams);
		pageIndex=1;
	}
	@Override
	public void onClick(View view) {
		if(view==ivQuit){
			ma.setContentView(ma.gui);
		}
	}
	@Override
	public boolean onLongClick(View view) {
		return false;
	}
	class CollectionListView extends MyListView{
		CollectionListView(MainActivity ma){
			super(ma);
		}
		@Override
		public View getView(View convert, int position) {
			return null;
		}
		@Override
		public int getCount() {
			return 0;
		}
		@Override
		protected void onLayout(boolean p, int p1, int p2, int p3, int p4) {
		}
	}
}
